﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderEdit.aspx.cs" Inherits="HQWeb.View.Order.OrderEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>订单</title>
    <base target="_self" />
    <script language="javascript" type="text/javascript" src="../../My97DatePicker/WdatePicker.js"></script>
    <link type="text/css" href="../../Styles/Site.css" rel="Stylesheet" />
    <link type="text/css" href="../../Styles/GridViewStyle.css" rel="Stylesheet" />
    <script type="text/javascript">
        //缩放功能
        function expandcollapse(obj, row) {
            var div = document.getElementById(obj);
            var img = document.getElementById(row);

            if (div.style.display == "none") {
                div.style.display = "";
                if (img != null) {
                    img.src = "../../Images/more.gif";
                    img.alt = "关闭显示";
                }

            }
            else {
                div.style.display = "none";
                if (img != null) {
                    img.src = "../../Images/more.gif";
                    img.alt = "显示下级菜单";
                }
            }
        }
        function CheckMessage(obj) {
            var varId = obj.id;
            var varValue = obj.value;
            var reDouble = /^(-|\+)?\d+\.?\d*$/;   //验证是否输入正确
            varValue = varValue.replace(/\s+/g, "");
            if (varValue != "") {
                if (!reDouble.test(varValue)) {
                    alert("必需为数值！");
                    obj.value = "";
                    return false;
                }
                var textRealTotal = document.getElementById("textRealTotal").value.replace(/\s+/g, "");
                var txtDinJin = document.getElementById("txtDinJin").value.replace(/\s+/g, "");
                var txtUnpaid = document.getElementById("txtUnpaid").value.replace(/\s+/g, "");
                if (textRealTotal != "") {
                    if (txtDinJin == "") {
                        document.getElementById("txtUnpaid").value = textRealTotal;
                    } else {
                        document.getElementById("txtUnpaid").value = parseFloat(textRealTotal) - parseFloat(txtDinJin);
                    }
                }
            }
        }
        function GetEditOrder() {
            var url = "Order/OrderSelectList.aspx";
            var feature = "dialogWidth:600px;dialogHeight:900px;center:yes;help:no;resizable:yes;status:no;";
            var returnValue = window.showModalDialog(url, "", feature);
            // alert(returnValue);
            if (!returnValue) {

                document.getElementById("hidOrderID").value = window.ReturnValue;
                // alert(document.getElementById("GetOrder"));
                document.getElementById("GetOrder").click();
            }
        }
        function FillStyle() {
            var styles = document.getElementById("hidStytle").value;
            var strArry = new Array();
            for (var i = 0; i < strArry.length; i++) {
                var varCheckBox = document.getElementById(strArry[1]);
                if (varCheckBox != undefined) {
                    varCheckBox.checked = true;
                }
            }
        }
        function GetStyle() {
            var tempValue;
            var checkValue = document.getElementsByName("checkBoxName");
            if (checkValue.length > 1) {
                if (checkValue[i].checked) {
                    tempValue = tempValue + checkValue[i].value + ",";
                }
            }
            document.getElementById("hidStytle").value = tempValue;
            return true;
        }
    </script>
    <style type="text/css">
        .Txt
        {
            border-left: 0px;
            border-right: 0px;
            border-top: 0px;
        }
        table td
        {
            border-left: 0px;
            border-right: 0px;
            padding-top: 3px;
            padding-bottom: 2px;
        }
        table tr
        {
            border: 1px solid #C1DAD7;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <table width="98%">
                    <tr>
                        <td colspan="4" class="title">
                            <asp:Label runat="server" Font-Size="Large" Font-Bold="true" ID="labTitle" Text="我的订单"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 20%">
                            庆典类型：
                        </td>
                        <td style="width: 30%; text-align: left">
                            <asp:DropDownList runat="server" ID="orderType">
                            </asp:DropDownList>
                            <input type="button" value="选择存在订单" onclick="GetEditOrder()" />
                        </td>
                        <td align="right" style="width: 20%">
                            服务日期：
                        </td>
                        <td align="left">
                            <input id="d12" runat="server" type="text" onfocus="WdatePicker()" class="Txt" />
                            <img onclick="WdatePicker({el:'d12'})" src="../../My97DatePicker/skin/datePicker.gif"
                                align="middle" width="16" height="28">
                            <asp:DropDownList runat="server" ID="dropDate">
                                <asp:ListItem Value="" Text="--请选择--">
                                </asp:ListItem>
                                <asp:ListItem Value="1" Text="上午"></asp:ListItem>
                                <asp:ListItem Value="2" Text="中午"></asp:ListItem>
                                <asp:ListItem Value="3" Text="下午"></asp:ListItem>
                                <asp:ListItem Value="4" Text="晚上"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            新郎姓名：
                        </td>
                        <%-- <th style="width: 12%;" align="right">
                    新郎姓名：
                </th>--%>
                        <td align="left">
                            <asp:TextBox ID="txtGROOM_NAME" runat="server" CssClass="Txt"></asp:TextBox>
                            <%--<asp:RequiredFieldValidator runat="server" ID="rev_Num" ControlToValidate="txtGROOM_NAME"
                        ForeColor="Red" ErrorMessage="请您输入姓名！" Display="Dynamic">--%><%--</asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="rev_price" runat="server" ControlToValidate="Materail_Num"
                        ForeColor="Red" ValidationExpression="^(\d)+(\.\d+)?$" ErrorMessage="请您输入正确的数量！"></asp:RegularExpressionValidator>--%>
                        </td>
                        <td align="right">
                            新娘姓名：
                        </td>
                        <%--  <th style="width: 12%;" align="right">
                    新娘姓名：
                </th>--%>
                        <td align="left">
                            <asp:TextBox ID="txtBRIDE_NAME" runat="server" CssClass="Txt"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            新郎年龄：
                        </td>
                        <%--  <th align="right">
                    新郎年龄：
                </th>--%>
                        <td align="left">
                            <asp:TextBox ID="txtGROOMAGE" runat="server" CssClass="Txt"></asp:TextBox>
                            <asp:RangeValidator ID="RangeValidator1" ControlToValidate="txtGROOMAGE" ForeColor="Red"
                                runat="server" ErrorMessage="输入正确的年龄！12-99" MaximumValue="99" MinimumValue="12"></asp:RangeValidator>
                        </td>
                        <td align="right">
                            新娘年龄：
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtBRIDEAGE" runat="server" CssClass="Txt"></asp:TextBox>
                            <asp:RangeValidator ID="RangeValidator2" ControlToValidate="txtBRIDEAGE" runat="server"
                                ForeColor="Red" ErrorMessage="输入正确的年龄！12-99" MaximumValue="99" MinimumValue="12"></asp:RangeValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            新郎电话：
                        </td>
                        <%-- <th align="right">
                    新郎电话：
                </th>--%>
                        <td align="left">
                            <asp:TextBox ID="txtGROOMPHONE" runat="server" CssClass="Txt"></asp:TextBox>
                        </td>
                        <td align="right">
                            新娘电话：
                        </td>
                        <%-- <th align="right">
                    新娘电话：
                </th>--%>
                        <td align="left">
                            <asp:TextBox ID="txtBRIDEPHONE" runat="server" CssClass="Txt"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            新郎QQ：
                        </td>
                        <%--<th align="right">
                    新郎QQ：
                </th>--%>
                        <td align="left">
                            <asp:TextBox ID="txtGROOMQQ" runat="server" CssClass="Txt"></asp:TextBox>
                        </td>
                        <td align="right">
                            新娘QQ：
                        </td>
                        <%--<th align="right">
                    新娘QQ：
                </th>--%>
                        <td align="left">
                            <asp:TextBox ID="txtBRIDEQQ" runat="server" CssClass="Txt"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            新房地址：
                        </td>
                        <%-- <th align="right">
                    新房地址：
                </th>--%>
                        <td align="left">
                            <asp:TextBox ID="txtHOUSEADDRESS" runat="server" CssClass="Txt"></asp:TextBox>
                        </td>
                        <td align="right">
                            娘家地址：
                        </td>
                        <%-- <th align="right">
                    娘家地址：
                </th>--%>
                        <td align="left">
                            <asp:TextBox ID="txtBRIDEADDRESS" runat="server" CssClass="Txt"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <%-- <th align="right">
                    婚礼日期：
                </th>--%>
                        <td align="right">
                            服务地址：
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtHOTEL" runat="server" CssClass="Txt"></asp:TextBox>
                        </td>
                        <td align="right">
                            业务来源：
                        </td>
                        <td align="left">
                            <asp:DropDownList runat="server" ID="dropFrom">
                            </asp:DropDownList>
                            <a href="javascript:expandcollapse('MoreInformation', 'img_show');">
                                <img id="img_show" alt="点击显示/隐藏下级菜单" width="64px" border="0" src="../../Images/more.gif" />
                            </a>
                        </td>
                    </tr>
                    <tbody id="MoreInformation" style="display: none">
                        <tr>
                            <td align="right">
                                新郎职务：
                            </td>
                            <%-- <th align="right">
                        新郎职务：
                    </th>--%>
                            <td align="left">
                                <asp:TextBox ID="txtGROOMPOST" runat="server" CssClass="Txt"></asp:TextBox>
                            </td>
                            <td align="right">
                                新娘职务：
                            </td>
                            <%--<th align="right">
                        新娘职务：
                    </th>--%>
                            <td align="left">
                                <asp:TextBox ID="txtBRIDEPOST" runat="server" CssClass="Txt"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                婚纱照交接情况：
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtWEDDING" runat="server" CssClass="Txt"></asp:TextBox>
                            </td>
                            <td align="right">
                                婚车负责人：
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtMARRIAGECAR" runat="server" CssClass="Txt"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                桌数：
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtTABLENUM" runat="server" CssClass="Txt"></asp:TextBox>
                            </td>
                            <td align="right">
                                来宾中长辈数：
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtELDER" runat="server" CssClass="Txt"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                新房地址：
                            </td>
                            <td>
                                <asp:TextBox ID="txtRANK" runat="server" CssClass="Txt"></asp:TextBox>
                            </td>
                            <td align="right">
                                来宾中后辈数：
                            </td>
                            <td>
                                <asp:TextBox ID="txtYOUNGER" runat="server" CssClass="Txt"></asp:TextBox>
                            </td>
                        </tr>
                    </tbody>
                    <tr>
                        <td align="right">
                            风格
                        </td>
                        <td colspan="3" runat="server" id="controls">
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            备注
                        </td>
                        <td colspan="3" align="left">
                            <asp:TextBox runat="server" ID="txtOther" TextMode="MultiLine" Width="558px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">
                            市面金额:<asp:TextBox ID="txtTotal" runat="server" CssClass="Txt" ReadOnly="true"></asp:TextBox>
                            签单金额：<asp:TextBox ID="textRealTotal" runat="server" CssClass="Txt" onblur="CheckMessage(this)"></asp:TextBox>
                            定金：<asp:TextBox ID="txtDinJin" runat="server" CssClass="Txt" onblur="CheckMessage(this)"></asp:TextBox>
                            未交金额:<asp:TextBox ID="txtUnpaid" runat="server" CssClass="Txt" ReadOnly="true"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtBRIDEQQ"
                                ForeColor="Red" ValidationExpression="^(\d)+(\.\d+)?$" ErrorMessage="输入正确的QQ！如347315619"></asp:RegularExpressionValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtGROOMQQ"
                                ForeColor="Red" ValidationExpression="^(\d)+(\.\d+)?$" ErrorMessage="输入正确的QQ！如347315619"></asp:RegularExpressionValidator>
                            <asp:Button ID="btn_Submit" runat="server" Text="提 交" OnClick="btn_Submit_Click"
                                OnClientClick="return GetStyle()" />
                            <asp:Button ID="Button1" runat="server" Text="修 改" OnClientClick="return GetStyle()"
                                OnClick="Button1_Click" />
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtBRIDEPHONE"
                                ForeColor="Red" ValidationExpression="^0{0,1}1[3|4|5|6|7|8|9][0-9]{9}$" ErrorMessage="输入正确的电话！如18229908533"></asp:RegularExpressionValidator>
                            <asp:RegularExpressionValidator ID="rev_price" runat="server" ControlToValidate="txtGROOMPHONE"
                                Display="Dynamic" ForeColor="Red" ValidationExpression="^0{0,1}1[3|4|5|6|7|8|9][0-9]{9}$"
                                ErrorMessage="输入正确的电话！如18229908533"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:GridView ID="GridView1" CssClass="GridViewStyle" runat="server" AutoGenerateColumns="False"
                                PageSize="25" Width="100%" AllowPaging="True" CellPadding="4" EmptyDataText="没有数据记录！！"
                                OnPageIndexChanging="GridView1_PageIndexChanging" GridLines="None" DataKeyNames="a"
                                OnRowDataBound="GridView1_RowDataBound">
                                <Columns>
                                    <asp:TemplateField ItemStyle-Width="5%">
                                        <ItemTemplate>
                                            <a href="javascript:expandcollapse('div<%# Eval("a") %>', '<%#Eval("a")%>');">
                                                <img id="imgdiv<%# Eval("a") %>" alt="点击显示/隐藏下级菜单 " width="9px" border="0" src="../../Images/expand_blue.jpg" />
                                            </a>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:ImageField DataImageUrlField="URLThumbnail" HeaderText="图片">
                                    </asp:ImageField>
                                    <asp:BoundField DataField="b" HeaderText="项目名称" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Center">
                                        <ItemStyle Width="25%"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="c" HeaderText="价 格" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
                                        <ItemStyle Width="20%"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="d" HeaderText="所属分类" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Center">
                                        <ItemStyle Width="25%"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:TemplateField HeaderText="操作" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25%">
                                        <ItemTemplate>
                                            <%-- 
                                    <asp:LinkButton ID="btnDelete" runat="server" Text="删 除" CommandName="Delete" CommandArgument='<%#Eval("a")%>'
                                        OnClientClick=" return confirm('确定删除？')"></asp:LinkButton>--%>
                                            <a style="cursor: pointer">移除</a>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <tr>
                                                <td colspan="100%">
                                                    <div id="div<%# Eval("a") %>" style="display: none; position: relative; left: 15px;
                                                        overflow: auto; width: 97%">
                                                        <asp:GridView ID="GridView2" AllowPaging="False" AllowSorting="true" BackColor="White"
                                                            Width="100%" AutoGenerateColumns="false" Font-Names="Verdana" runat="server"
                                                            DataKeyNames="a" ShowFooter="true" BorderStyle="Double" BorderColor="#0083C1">
                                                            <RowStyle BackColor="Gainsboro" />
                                                            <AlternatingRowStyle BackColor="White" />
                                                            <HeaderStyle BackColor="#0083C1" ForeColor="White" />
                                                            <FooterStyle BackColor="White" />
                                                            <Columns>
                                                                <asp:BoundField DataField="c" HeaderText="名称 " ItemStyle-HorizontalAlign="Center" />
                                                                <asp:BoundField DataField="b" HeaderText="数量 " ItemStyle-HorizontalAlign="Center" />
                                                            </Columns>
                                                        </asp:GridView>
                                                    </div>
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <PagerTemplate>
                                    <table width="100%">
                                        <tr>
                                            <td style="text-align: center">
                                                第<asp:Label ID="lblPageIndex" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1  %>' />页
                                                共<asp:Label ID="lblPageCount" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount  %>' />页
                                                <asp:LinkButton ID="btnFirst" runat="server" CausesValidation="False" CommandArgument="First"
                                                    CommandName="Page" Text="首页" />
                                                <asp:LinkButton ID="btnPrev" runat="server" CausesValidation="False" CommandArgument="Prev"
                                                    CommandName="Page" Text="上一页" />
                                                <asp:LinkButton ID="btnNext" runat="server" CausesValidation="False" CommandArgument="Next"
                                                    CommandName="Page" Text="下一页" />
                                                <asp:LinkButton ID="btnLast" runat="server" CausesValidation="False" CommandArgument="Last"
                                                    CommandName="Page" Text="尾页" />
                                                <asp:TextBox ID="txtNewPageIndex" runat="server" Width="28px" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1  %>' />
                                                <asp:LinkButton ID="btnGo" runat="server" CausesValidation="False" CommandArgument="-1"
                                                    CommandName="Page" Text="GO" /><!-- here set the CommandArgument of the Go Button to '-1' as the flag -->
                                            </td>
                                        </tr>
                                    </table>
                                </PagerTemplate>
                                <FooterStyle CssClass="GridViewFooterStyle" />
                                <RowStyle CssClass="GridViewRowStyle" />
                                <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                                <PagerStyle CssClass="GridViewPagerStyle" />
                                <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                <HeaderStyle CssClass="GridViewHeaderStyle" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
                <div style="display: none">
                    <asp:HiddenField runat="server" ID="hidOrderID" />
                    <asp:HiddenField ID="hidProjectID" runat="server" />
                    <asp:HiddenField ID="hidSubmitType" runat="server" />
                    <asp:HiddenField ID="hidStytle" runat="server" />
                    <asp:Button runat="server" ID="GetOrder" OnClick="GetOrder_Click" />
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
